home *** CD-ROM | disk | FTP | other *** search
- /*
- File: RunsRanges.h
-
- Contains: xxx put contents here xxx
-
- Written by: Essam Zaky
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 1/4/94 EZ clean up
- <1> 1/4/94 EZ first checked in
-
- */
-
- #ifndef _Runs_
- #define _Runs_
-
- #ifndef _ToolBoxDump_
- #include "ToolBoxDump.h"
- #endif
-
- #ifndef _TextensionCommon_
- #include "TextensionCommon.h"
- #endif
-
- #ifndef _Array_
- #include "Array.h"
- #endif
-
- #ifndef _RunObject_
- #include "RunObject.h"
- #endif
-
- #ifndef _ObjectsRanges_
- #include "ObjectsRanges.h"
- #endif
- //***************************************************************************************************
-
-
- class CRunsRanges : public CObjectsRanges {
- public:
- CRunsRanges();
-
- void IRunsRanges(CAttrObject* protoObj, TSize sizeInfo = kLargeSize);
-
- inline short GetNextRun(long offset, CRunObject** theRun, long* runLen) const
- {return this->GetNextObjectRange(offset, (CAttrObject**)theRun, runLen);}
- // returns the run index, -1 if no next
-
- char GetScriptRange(TOffset charOffset, long *startOffset, long *countChars) const;
- //return theScript
-
- CRunObject* Char2TextRun(TOffset charOffset) const;
- /*
- -returns the nearest run to "charOffset" having text class type.
- -returns nil if no such run
- */
-
- CRunObject* Char2ScriptRun(TOffset charOffset, char theScript) const;
- /*
- -returns the nearest run to "charOffset" having the script "theScript".
- -returns nil if no such run
- */
-
- protected:
-
- private:
- CRunObject* IsSameScript(short runIndex, char theScript) const;
-
- CRunObject* IsTextRun(short runIndex) const;
-
- CRunObject* SearchScriptBackward(short runIndex, char theScript) const;
- CRunObject* SearchScriptForward(short runIndex, char theScript) const;
-
- CRunObject* SearchTextRunBackward(short runIndex) const;
- CRunObject* SearchTextRunForward(short runIndex) const;
- };
- //**************************************************************************************************
-
- #endif
-